<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>

</head>
<body>
<form class="form-horizontal" role="form" id="form">
    <div class="form-group">
        <label for="saveUser" class="col-sm-2 control-label">角色</label>
        <div class="col-sm-10">
            <div id="saveUser" class="cc-CheckBoxListDict" onclick="changeHandler"   nameCn="角色" required="true"   model="1" initValue="3"  data-options="'dictCode':'search_type'" style="width: 300px"   remark="由6-10位字母和数字组成"></div>

            <!--
                    <div id="saveUser" class="cc-CheckBox"  model="1"  initValue="1" onchange="changeHandler"  data="{'id':1,'name':'是否保存用户名'}"  nameCn="是否保存用户名" required="true"   data-options=""   remark="由6-10位字母和数字组成"></div>


                           <div id="saveUser" class="cc-RadioBoxListDict" onclick="changeHandler"   nameCn="角色" required="true"   model="1" initValue="3,4,5"  data-options="'dictCode':'search_type'" style="width: 300px"   remark="xxxx"></div>
                         <div id="saveUser" class="cc-CheckBoxListDict" onclick="changeHandler"   nameCn="角色" required="true"   model="1" initValue="3"  data-options="'dictCode':'search_type'" style="width: 300px"   remark="由6-10位字母和数字组成"></div>


                          <div id="saveUser" class="cc-CheckBoxList" onclick="changeHandler"    nameCn="角色" required="true"   model="1"   data-options="'call':'role.globalRoles'" style="width: 300px" ></div>
                         <div id="saveUser" class="cc-RadioBoxList" onclick="changeHandler"    nameCn="角色" required="true"   model="1"   data-options="'call':'role.globalRoles'" style="width: 300px" ></div>

                    <div id="saveUser" class="cc-CheckBox"  model="1"  initValue="1" onchange="changeHandler"  data="{'id':1,'name':'是否保存用户名'}"  nameCn="是否保存用户名" required="true"   data-options=""   remark="由6-10位字母和数字组成"></div>
              -->
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type="button" value="isValid" onclick="isValid()">
            <input type="button" value="getAddData" onclick="getAddData()">
            <input type="button" value="getEditData" onclick="getEditData()">
            <input type="button" value="getQueryData" onclick="getQueryData()">
            <input type="button" value="setValue" onclick="setValue()">
            <input type="button" value="getValue" onclick="getValue()">
        </div>
    </div>
</form>


<!--#include file="common.shtml"-->



<script type="text/javascript">
    function changeHandler(e){
        console.log(e.value)
    }


    function isValid(){
        var form = new _$.Form("#form");
        var flag = form.isValid();
        if(flag){
            alert(flag)
        }

    }
    function getAddData(){

        var form = new _$.Form("#form");
        var values = form.getAddData();
        alert(JSON.stringify(values))
    }
    function getEditData(){

        var form = new _$.Form("#form");
        var values = form.getEditData();
        alert(JSON.stringify(values))
    }
    function getQueryData(){
        var form = new _$.Form("#form");
        var values = form.getQueryData();
        alert(JSON.stringify(values))
    }

    function setValue(){
        var name = _$.getById("saveUser");
        name.setValue("2,4,3");
    }
    function getValue(){
        var name = _$.getById("saveUser");
        var str = name.getValue();
        alert(str)
    }
    _$.parser.onComplete = function(){
        logger("------初始化页面完成---------");

    };
    $(function(){
        _$.parser.parse();
    })
</script>
</body>
</html>
